package com.yooohooo.designpattern.bean.store;

import com.yooohooo.designpattern.bean.phone.Phone;
import com.yooohooo.designpattern.factory.method.PhoneFactory;
import com.yooohooo.designpattern.factory.method.SonyPhoneFactory;

/**
 * @ClassName: Store
 * @Description:
 * @author Yooo
 * @date 2017年6月16日 上午1:37:28
 * 
 */
public class StoreB {
	private PhoneFactory phoneFactory;

	public StoreB(PhoneFactory phoneFactory) {
		super();
		this.phoneFactory = phoneFactory;
	}

	/**
	 * 补充手机
	 */
	public void supplyPhone() {
		Phone phone = phoneFactory.getPhone();
		// 补充手机逻辑...
		System.out.println("补充" + phone.getBrand() + "手机完成");
	}

	public static void main(String[] args) {
		StoreB storeB = new StoreB(new SonyPhoneFactory());
		storeB.supplyPhone();
	}
}
